<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="author" content="Fishy McFishperson" />

<meta name="date" content="2019-07-20" />

<title>Barebones FishSET Vignette</title>



<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
  { position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
  { content: attr(title);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; pointer-events: all; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
    color: #aaaaaa;
  }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
div.sourceCode
  {  }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */

</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
  var sheets = document.styleSheets;
  for (var i = 0; i < sheets.length; i++) {
    if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
    try { var rules = sheets[i].cssRules; } catch (e) { continue; }
    for (var j = 0; j < rules.length; j++) {
      var rule = rules[j];
      // check if there is a div.sourceCode rule
      if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
      var style = rule.style.cssText;
      // check if color or background-color is set
      if (rule.style.color === '' || rule.style.backgroundColor === '') continue;
      // replace div.sourceCode by a pre.sourceCode rule
      sheets[i].deleteRule(j);
      sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
    }
  }
})();
</script>



<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#header {
text-align: center;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap; 
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }

code > span.kw { color: #555; font-weight: bold; } 
code > span.dt { color: #902000; } 
code > span.dv { color: #40a070; } 
code > span.bn { color: #d14; } 
code > span.fl { color: #d14; } 
code > span.ch { color: #d14; } 
code > span.st { color: #d14; } 
code > span.co { color: #888888; font-style: italic; } 
code > span.ot { color: #007020; } 
code > span.al { color: #ff0000; font-weight: bold; } 
code > span.fu { color: #900; font-weight: bold; }  code > span.er { color: #a61717; background-color: #e3d2d2; } 
</style>




</head>

<body>




<h1 class="title toc-ignore">Barebones FishSET Vignette</h1>
<h4 class="author">Fishy McFishperson</h4>
<h4 class="date">2019-07-20</h4>



<p>Runs discrete choice models. If you run into problems you can contact <a href="mailto:allen.chen@noaa.gov" class="email">allen.chen@noaa.gov</a>.</p>
<ul>
<li>User supplies <code>catch</code>, <code>choice</code>, and <code>distance</code> data, plus any other data <code>otherdat</code> they need to run their chosen likelihood.</li>
<li>Currently ships with a conditional logit function <code>logit_c</code>, an average catch logit function <code>logit_avgcat</code>, a full information likelihood with correction function <code>logit_correction</code>, an expected profit model with a normally distributed catch function <code>epm_normal</code>, an expected profit model with a log-normally distributed catch function <code>epm_lognormal</code>, and an expected profit model with a weibull distributed catch function <code>epm_weibull</code>.</li>
</ul>
<div id="data" class="section level2">
<h2>Data</h2>
<p>The user supplies <code>catch</code>, <code>choice</code>, and <code>distance</code> data. The data <code>catch</code> and <code>choice</code> should be dimensions <em>(number of observations) x 1</em>.</p>
<p>(Simulated catch and choice data are included in this package i.e. <code>data(catch)</code>.)</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="kw">str</span>(catch)</a>
<a class="sourceLine" id="cb1-2" title="2"><span class="co">#&gt; &#39;data.frame&#39;:    4000 obs. of  1 variable:</span></a>
<a class="sourceLine" id="cb1-3" title="3"><span class="co">#&gt;  $ V1: num  8.163 7.367 -0.773 2.059 6.57 ...</span></a>
<a class="sourceLine" id="cb1-4" title="4"><span class="kw">str</span>(choice)</a>
<a class="sourceLine" id="cb1-5" title="5"><span class="co">#&gt; &#39;data.frame&#39;:    4000 obs. of  1 variable:</span></a>
<a class="sourceLine" id="cb1-6" title="6"><span class="co">#&gt;  $ V1: num  1 1 1 1 2 1 4 1 1 1 ...</span></a></code></pre></div>
<p>The <code>distance</code> data should be dimensions <em>(number of observations) x (number of alternatives)</em>. (Simulated distance data is included in this package i.e. <code>data(distance)</code>.)</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw">str</span>(distance)</a>
<a class="sourceLine" id="cb2-2" title="2"><span class="co">#&gt; &#39;data.frame&#39;:    4000 obs. of  4 variables:</span></a>
<a class="sourceLine" id="cb2-3" title="3"><span class="co">#&gt;  $ V1: num  0 0 0 0 0 0 0 0 0 0 ...</span></a>
<a class="sourceLine" id="cb2-4" title="4"><span class="co">#&gt;  $ V2: num  1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 ...</span></a>
<a class="sourceLine" id="cb2-5" title="5"><span class="co">#&gt;  $ V3: num  1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 ...</span></a>
<a class="sourceLine" id="cb2-6" title="6"><span class="co">#&gt;  $ V4: num  2.12 2.12 2.12 2.12 2.12 ...</span></a></code></pre></div>
<p>Other data may be something like <code>predicted_catch</code> for each alternative (e.g. with dimensions <em>(number of observations) x (number of alternatives)</em>). This data could be constructed by the user before estimation of the discrete choice model, for example by looking at a moving average of historical catches. Below is an example of predicted catches, as well as a data frame <code>zi</code> representing harvester characteristics. (Simulated harvester characteristics and predicted data are included in this package i.e. <code>data(predicted_catch)</code>.)</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1"><span class="kw">str</span>(otherdat)</a>
<a class="sourceLine" id="cb3-2" title="2"><span class="co">#&gt; List of 2</span></a>
<a class="sourceLine" id="cb3-3" title="3"><span class="co">#&gt;  $ griddat:List of 1</span></a>
<a class="sourceLine" id="cb3-4" title="4"><span class="co">#&gt;   ..$ si: num [1:4000, 1:4] 7.5 7.5 1.5 7.5 6 1.5 3 4.5 7.5 7.5 ...</span></a>
<a class="sourceLine" id="cb3-5" title="5"><span class="co">#&gt;   .. ..- attr(*, &quot;dimnames&quot;)=List of 2</span></a>
<a class="sourceLine" id="cb3-6" title="6"><span class="co">#&gt;   .. .. ..$ : NULL</span></a>
<a class="sourceLine" id="cb3-7" title="7"><span class="co">#&gt;   .. .. ..$ : chr [1:4] &quot;V1&quot; &quot;V2&quot; &quot;V3&quot; &quot;V4&quot;</span></a>
<a class="sourceLine" id="cb3-8" title="8"><span class="co">#&gt;  $ intdat :List of 1</span></a>
<a class="sourceLine" id="cb3-9" title="9"><span class="co">#&gt;   ..$ zi: num [1:4000, 1] 5 10 8 6 6 8 1 8 10 1 ...</span></a>
<a class="sourceLine" id="cb3-10" title="10"><span class="co">#&gt;   .. ..- attr(*, &quot;dimnames&quot;)=List of 2</span></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">#&gt;   .. .. ..$ : NULL</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">#&gt;   .. .. ..$ : chr &quot;V1&quot;</span></a></code></pre></div>
<p>For the <code>logit_c</code> function, any number of grid-specific variables (e.g. expected catch that varies by location) or interaction variables (e.g. vessel characteristics that affect how much disutility is suffered by traveling a greater distance) are allowed. However, the user must place these in <code>otherdat</code> as list objects named <code>griddat</code> and <code>intdat</code> respectively. Note the variables within <code>griddat</code> and <code>intdat</code> have no naming restrictions. Also note that for this likelihood <code>griddat</code> variables are dimension <em>(number of observations) x (number of alternatives)</em>, while <code>intdat</code> variables are dimension <em>(number of observations) x 1</em>, to be interacted with the distance to each alternative.</p>
<p>If there are no other data, the user can set <code>griddat</code> as ones with dimension <em>(number of observations) x (number of alternatives)</em> and <code>intdat</code> variables as ones with dimension <em>(number of observations) x 1</em>. Finally, users can write their own likelihoods, and this example is specific to the package-supplied conditional logit (<code>logit_c</code>) function (see documentation for other likelihoods).</p>
</div>
<div id="to-run-models-call-the-discretefish_subroutine-function" class="section level2">
<h2>To run models call the <code>discretefish_subroutine</code> function</h2>
<p>The user supplies initial parameters, optimization options, the likelihood function name, and the optimization method for a total of 8 inputs. For example:</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1">initparams &lt;-<span class="st"> </span><span class="kw">c</span>(<span class="fl">2.5</span>, <span class="fl">-0.8</span>)</a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co">#Initial paramters for revenue then cost.</span></a>
<a class="sourceLine" id="cb4-3" title="3"></a>
<a class="sourceLine" id="cb4-4" title="4">optimOpt &lt;-<span class="st"> </span><span class="kw">c</span>(<span class="dv">1000</span>,<span class="fl">1.00000000000000e-08</span>,<span class="dv">1</span>,<span class="dv">1</span>)</a>
<a class="sourceLine" id="cb4-5" title="5"><span class="co">#Optimization options for the maximum iterations, the relative tolerance of x,</span></a>
<a class="sourceLine" id="cb4-6" title="6">    <span class="co">#report frequency, and whether to report iterations.</span></a>
<a class="sourceLine" id="cb4-7" title="7"></a>
<a class="sourceLine" id="cb4-8" title="8">func &lt;-<span class="st"> </span>logit_c</a>
<a class="sourceLine" id="cb4-9" title="9"><span class="co">#The conditional logit likelihood function.</span></a>
<a class="sourceLine" id="cb4-10" title="10"></a>
<a class="sourceLine" id="cb4-11" title="11">methodname &lt;-<span class="st"> &quot;BFGS&quot;</span></a>
<a class="sourceLine" id="cb4-12" title="12"><span class="co">#The optimization method chosen, which must be one of the base R `optim`</span></a>
<a class="sourceLine" id="cb4-13" title="13">    <span class="co">#options.</span></a></code></pre></div>
<p>The subroutine function takes in 8 inputs and outputs model results in a list that can be summarized as:</p>
<pre><code>errorExplain: If it exists, a description of the model error.
OutLogit: A matrix of coefficients, standard errors, and t-statistics
optoutput: Optimization information (such as number of function iterations)
seoutmat2: Standard errors
MCM: Model comparison metrics (e.g. AIC, BIC)
H1: The inverse hessian</code></pre>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1">results &lt;-<span class="st"> </span><span class="kw">discretefish_subroutine</span>(catch,choice,distance,otherdat,initparams,</a>
<a class="sourceLine" id="cb6-2" title="2">    optimOpt,func,methodname)</a>
<a class="sourceLine" id="cb6-3" title="3"><span class="co">#&gt; initial  value 10730.328489 </span></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="co">#&gt; iter   2 value 8423.668605</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="co">#&gt; iter   3 value 7642.847346</span></a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">#&gt; iter   4 value 5498.211667</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">#&gt; iter   5 value 5494.555786</span></a>
<a class="sourceLine" id="cb6-8" title="8"><span class="co">#&gt; iter   6 value 4498.304178</span></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">#&gt; iter   7 value 4432.995053</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co">#&gt; iter   8 value 4426.412752</span></a>
<a class="sourceLine" id="cb6-11" title="11"><span class="co">#&gt; iter   9 value 4425.953316</span></a>
<a class="sourceLine" id="cb6-12" title="12"><span class="co">#&gt; iter  10 value 4425.953019</span></a>
<a class="sourceLine" id="cb6-13" title="13"><span class="co">#&gt; iter  10 value 4425.953019</span></a>
<a class="sourceLine" id="cb6-14" title="14"><span class="co">#&gt; iter  10 value 4425.953019</span></a>
<a class="sourceLine" id="cb6-15" title="15"><span class="co">#&gt; final  value 4425.953019 </span></a>
<a class="sourceLine" id="cb6-16" title="16"><span class="co">#&gt; converged</span></a>
<a class="sourceLine" id="cb6-17" title="17">results</a>
<a class="sourceLine" id="cb6-18" title="18"><span class="co">#&gt; $errorExplain</span></a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co">#&gt; NULL</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-21" title="21"><span class="co">#&gt; $OutLogit</span></a>
<a class="sourceLine" id="cb6-22" title="22"><span class="co">#&gt;            [,1]        [,2]      [,3]</span></a>
<a class="sourceLine" id="cb6-23" title="23"><span class="co">#&gt; [1,]  0.4187095 0.020404786  20.52016</span></a>
<a class="sourceLine" id="cb6-24" title="24"><span class="co">#&gt; [2,] -0.1404274 0.003475385 -40.40630</span></a>
<a class="sourceLine" id="cb6-25" title="25"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-26" title="26"><span class="co">#&gt; $optoutput</span></a>
<a class="sourceLine" id="cb6-27" title="27"><span class="co">#&gt; $optoutput$counts</span></a>
<a class="sourceLine" id="cb6-28" title="28"><span class="co">#&gt; function gradient </span></a>
<a class="sourceLine" id="cb6-29" title="29"><span class="co">#&gt;       43       10 </span></a>
<a class="sourceLine" id="cb6-30" title="30"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-31" title="31"><span class="co">#&gt; $optoutput$convergence</span></a>
<a class="sourceLine" id="cb6-32" title="32"><span class="co">#&gt; [1] 0</span></a>
<a class="sourceLine" id="cb6-33" title="33"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-34" title="34"><span class="co">#&gt; $optoutput$optim_message</span></a>
<a class="sourceLine" id="cb6-35" title="35"><span class="co">#&gt; NULL</span></a>
<a class="sourceLine" id="cb6-36" title="36"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-37" title="37"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-38" title="38"><span class="co">#&gt; $seoutmat2</span></a>
<a class="sourceLine" id="cb6-39" title="39"><span class="co">#&gt;            [,1]        [,2]</span></a>
<a class="sourceLine" id="cb6-40" title="40"><span class="co">#&gt; [1,] 0.02040479 0.003475385</span></a>
<a class="sourceLine" id="cb6-41" title="41"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-42" title="42"><span class="co">#&gt; $MCM</span></a>
<a class="sourceLine" id="cb6-43" title="43"><span class="co">#&gt; $MCM$AIC</span></a>
<a class="sourceLine" id="cb6-44" title="44"><span class="co">#&gt; [1] -8847.906</span></a>
<a class="sourceLine" id="cb6-45" title="45"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-46" title="46"><span class="co">#&gt; $MCM$AICc</span></a>
<a class="sourceLine" id="cb6-47" title="47"><span class="co">#&gt; [1] -8847.903</span></a>
<a class="sourceLine" id="cb6-48" title="48"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-49" title="49"><span class="co">#&gt; $MCM$BIC</span></a>
<a class="sourceLine" id="cb6-50" title="50"><span class="co">#&gt; [1] -8835.318</span></a>
<a class="sourceLine" id="cb6-51" title="51"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-52" title="52"><span class="co">#&gt; $MCM$PseudoR2</span></a>
<a class="sourceLine" id="cb6-53" title="53"><span class="co">#&gt; [1] 0.5875287</span></a>
<a class="sourceLine" id="cb6-54" title="54"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-55" title="55"><span class="co">#&gt; </span></a>
<a class="sourceLine" id="cb6-56" title="56"><span class="co">#&gt; $H1</span></a>
<a class="sourceLine" id="cb6-57" title="57"><span class="co">#&gt;               [,1]          [,2]</span></a>
<a class="sourceLine" id="cb6-58" title="58"><span class="co">#&gt; [1,]  4.163553e-04 -1.673161e-05</span></a>
<a class="sourceLine" id="cb6-59" title="59"><span class="co">#&gt; [2,] -1.673161e-05  1.207830e-05</span></a></code></pre></div>
<p>The true marginal utility from catch in this data-generating process was equal to 3, and the true disutility from distance was equal to -1. The model estimates are correct relative to some unknown scale parameter:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">results<span class="op">$</span>OutLogit[<span class="dv">1</span>,<span class="dv">1</span>]<span class="op">/</span>results<span class="op">$</span>OutLogit[<span class="dv">2</span>,<span class="dv">1</span>]</a>
<a class="sourceLine" id="cb7-2" title="2"><span class="co">#&gt; [1] -2.981679</span></a></code></pre></div>
</div>



<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src  = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>

</body>
</html>
